﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;


namespace FitCalc.Models
{
    public class PaceSpeedCalculatorModel
    {
        [Required]
        [StringLength(2, MinimumLength = 1)]
        [Display(Name = "Minutes")]
        [RegularExpression(@"[0-9]{1,2}", ErrorMessage = "Minutes must be in the range 00-99")]
        [ScaffoldColumn(false)]
        [DataType(DataType.Text)]
        [Range(0,99)]
        public string paceMinutes { get; set; }

        [Required]
        [StringLength(2, MinimumLength = 1)]
        [Display(Name = "Seconds")]
        [RegularExpression(@"[0-9]{1,2}", ErrorMessage = "Seconds must be in the range 00-59")]
        [ScaffoldColumn(false)]
        [DataType(DataType.Text)]
        [Range(0, 59)]
        public string paceSeconds { get; set; }

        [Required]
        [StringLength(5, MinimumLength = 1)]
        [Display(Name = "speed")]
        [ScaffoldColumn(false)]
        [DataType(DataType.Text)]
        [Range(0,99)]
        public string speed { get; set; }

        public PaceSpeedCalculatorModel()
        {
            paceMinutes = "5";
            paceSeconds = "0";
            speed = "12";
        }
    }
}